#include <iostream>
using namespace std;

class Time{
    private:
        int hour;
        int min;
        int sec;
    public:
        Time(){}
        Time(int h, int m, int s):hour(h), min(m), sec(s){}
        ~Time(){}
        // 声明 show_time 是 Time 类的友元函数
        // 在 show_time 函数中就可以访问 Time 类的私有成员了
        friend void show_time(Time &r);
};

void show_time(Time &r){
    cout << r.hour << ":" << r.min << ":" << r.sec << endl;
}

int main(int argc, const char *argv[]){
    Time t1(10, 15, 23);
    show_time(t1);
    return 0;
}